#ifndef SERVER_H
#define SERVER_H
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <pthread.h>
#include "chatDatabase.h"
#include "userManage.h"
typedef struct msg
{
    // struct sockdadd_in clientAddr;
    struct sockaddr_in clientAddr;
    int clientFd;
    /* data */
} MSG;
// 定义一个线程参数
class Server
{
private:
    const char *ip;
    int port;
    int socketFd;
    /* data */
public:
    Server(const char *ip, int port);
    ~Server();
    // 处理线程的函数
    static void *pthread_func(void *arg);
    int startServer();
    int closeServer();
};

#endif /* SERVER_H */
